package com.zxx.ssm.controller;

import com.zxx.ssm.dao.Agency;
import com.zxx.ssm.dao.AgencyExample;
import com.zxx.ssm.model.result.BizResponse;
import com.zxx.ssm.service.AgencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("agency")
@Controller
public class AgencyController {
    @Autowired
    private AgencyService agencyService;

    @RequestMapping(value = "getAll", method = RequestMethod.GET)
    @ResponseBody
    public BizResponse getAllCourse() {
        BizResponse bizResponse = new BizResponse();
        AgencyExample agencyExample = new AgencyExample();
        List<Agency> agencyList = agencyService.selectByExample(agencyExample);
        bizResponse.put("agencyList", agencyList);
        return bizResponse;
    }

}
